package netapp.udp;

import java.io.IOException;
import java.net.*;
import java.util.Scanner;

public class Client {
    public static void main(String[] args) throws IOException, InterruptedException {
//        while (true) {
            DatagramSocket ds = new DatagramSocket();
            Scanner sc = new Scanner(System.in);
            while (true) {
                    String str = sc.next();
                    if ("886".equals(str)) {
                            break;
                    }
                    byte[] bytes = str.getBytes();
                    int len = bytes.length;
                    InetAddress ip = InetAddress.getByName("127.0.0.1");
                    int port = 8888;
                    DatagramPacket dp = new DatagramPacket(bytes,len,ip,port);
//                    Thread.sleep(100);
                    ds.send(dp);
            }
            ds.close();
//        }
    }
}
